<?php

namespace Admin\Controller;

class CateController extends AdminController
{
    public function index()
    {
         $res=$this->digui();
           var_dump($res);
           $this->assign('list',$res);
            $this->display();
       
    }
    public function digui($fid=0,$return=[]){
    	   $cate=M('cate');
           $res=$cate->where(['fid'=>$fid])->select();
           if ($res) {
                   foreach ($res as $v) {
                         $return[]=$v;
                         $return=$this->digui($v['id'],$return);
                   }
           }
           return   $return;
    }



}
